/**
 * Project Name:template-web
 * File Name   :IBaseDao.java
 * Package Name:org.cn.template.component.repository
 * Date:2015年9月27日下午3:41:24
 * Copyright (c) 2015, http://my.oschina.net/httpssl All Rights Reserved.
 *
*/

package org.cn.template.component.repository;

import java.util.List;
import java.util.Map;

import org.cn.template.component.domain.PersistentModel;

/**
 * ClassName:IBaseDao <br/>
 * Function :TODO ADD FUNCTION. <br/>
 * Reason :TODO ADD REASON. <br/>
 * Date :2015年9月27日 下午3:41:24 <br/>
 * 
 * @author :http://my.oschina.net/httpssl
 * @email :491835898@QQ.COM
 * @since :JDK 1.7
 * @see
 */
public interface IBaseDao<T extends PersistentModel>
{
	public T insertOne(T model) throws Exception;

	public void insertBatch(final List<T> models) throws Exception;

	public int deleteById(@SuppressWarnings("rawtypes")Map paramMap) throws Exception;

	public int delete(T param) throws Exception;

	public int updateById(T model) throws RuntimeException;

	public <V extends T> V selectOne(T query) throws Exception;

	public <V extends T> V selectById(@SuppressWarnings("rawtypes")Map paramMap) throws Exception;

	public <V extends T> List<V> selectList(T query) throws Exception;

	/**
	 * selectList:(这里用一句话描述这个方法的作用). <br/>  
	 * statement 执行的SQLMAP id
	 * paramMap 参数
	 * 返回:List<V>
	 * @exception
	 */
	public <V extends T> List<V> selectList(String statement,Map<String, ?> paramMap) throws Exception;

	public List<?> selectMapList(String statement,Map<String, ?> paramMap) throws Exception;

	public <V extends T> List<V> selectList(T query,@SuppressWarnings("rawtypes")Map page) throws Exception;

	public Long selectListCount(T query) throws Exception;

	public List<?> getList(String statement,Map<String, ?> paramMap) throws Exception;

	public Long getListCount(String statement, Map<String, ?> paramMap) throws Exception;
}
